home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Texteditors / AlphaSpell / iaspell.rexx < prev    next >
OS/2 REXX Batch file  |  1996-09-26  |  2KB  |  55 lines

  1. /**************************************************************************/
  2. /* iaspell.rexx - Interactive spell checking with AlphaSpell              */
  3. /* $VER: iaspell.rexx 1.1 (29 Aug 1995)                                   */
  4. /* Copyright © 1995 Fergus Duniho                                         */
  5. /**************************************************************************/
  6. /* This script can be used to provide interactive spell checking to an    */
  7. /* ARexx capable text editor. To use it, your editor needs a way to read  */
  8. /* the last word typed and a way to pass it to ARexx. This script assumes */
  9. /* that the word to be checked is passed as an argument to the script,    */
  10. /* but you could adapt the script to read the word itself. The only other */
  11. /* capability your editor needs to use this script for interactive spell  */
  12. /* checking is the ability to remap the space bar. To use this script,    */
  13. /* remap the space bar to call this script. When you misspell a word,     */
  14. /* script will beep the screen. You may want to adapt it to also tell you */
  15. /* what word was misspelled. It would do this by displaying the value     */
  16. /* passed to the environment variable Word.                               */
  17. /**************************************************************************/
  18.  
  19. if exists("libs:rexxarplib.library") then do
  20.     if ~show("L","rexxarplib.library") then
  21.         call addlib("rexxarplib.library",0,-30)
  22. end
  23. else say "You need RexxArpLib.library"
  24.  
  25. if exists("libs:rxgen.library") then do
  26.     if ~show('L','rxgen.library') then
  27.         call addlib('rxgen.library',0,-30,0)
  28. end
  29. else say "You need rxgen.library"
  30.  
  31. Parse Arg word
  32.  
  33. com = "AlphaSpell >ENV:Word -To ENV:ok -d" GetENV("DDIR") "-w" word GetENV("Dict")
  34.  
  35. ADDRESS COMMAND com
  36.  
  37. /* Here is one way to get an audible beep whenever you mistype a word.
  38. ** You will need jbplay, available from the Aminet in mus/play, and a
  39. ** sound sample, such as Shortbeep, found in mods/smpl. You should
  40. ** specify a path name for the sample */
  41.  
  42. /* ADDRESS COMMAND "jbplay Shortbeep" */
  43.  
  44. IF GetENV("ok") = "0" THEN DO
  45.         LIBS.intuition = '00 00 00 00'x
  46.         LIBS.intuition.OPENCOUNT = 0
  47.         LIBS.intuition.DisplayBeep='FFA0'x||I||'2009'x
  48.  
  49.         CALL GenOpenLib("intuition",0)
  50.         CALL GenACall("intuition","DisplayBeep",0)
  51.         CALL GenCloseLib("intuition")
  52. END
  53.  
  54. EXIT
  55.